/**
 * product
 */

import request from '@/util/request'

// brand list
export function brandList(data) {
  return request({
    url: '/api/brand/list',
    method: 'post',
    data
  })
}

// brand view
export function brandView(data) {
  return request({
    url: '/api/brand/view',
    method: 'post',
    data
  })
}

// -------------------------------------------------------

// area list
export function areaList(data) {
  return request({
    url: '/api/area/list',
    method: 'post',
    data
  })
}

// -------------------------------------------------------

// category list
export function categoryByParent(data) {
  return request({
    url: '/api/category/category-by-parent',
    method: 'post',
    data
  })
}

// category product list
export function categoryProduct(data) {
  return request({
    url: '/api/category/product-by-category',
    method: 'post',
    data
  })
}

// 一级分类的产品
export function getOneProduct(data) {
  return request({
    url: '/api/category/one-product',
    method: 'post',
    data
  })
}

// -------------------------------------------------------

// product list
export function list(data) {
  return request({
    url: '/api/product/list',
    method: 'post',
    data
  })
}

export function newList(data) {
  return request({
    url: '/api/product/new-list',
    method: 'post',
    data
  })
}

// product detail
export function detail(data) {
  return request({
    url: '/api/product/detail',
    method: 'post',
    data
  })
}

// qrcode share
export function qrcodeShare(data) {
  return request({
    url: '/api/product/qrcode-share',
    method: 'post',
    data
  })
}

// -------------------------------------------------------

// like product
export function like(data) {
  return request({
    url: '/api/product/like',
    method: 'post',
    data
  })
}


// -------------------------------------------------------

// comment
export function comment(data) {
  return request({
    url: '/api/comment/list-by-product',
    method: 'post',
    data
  })
}
